package com.example.cdctestsystem.managecontroller;

import com.example.cdctestsystem.pojo.QuestionType;
import com.example.cdctestsystem.service.QuestionService;
import com.example.cdctestsystem.service.QuestionTypeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/manage/question")
public class QuestionController
{
    @Resource
    private QuestionService questionService;

    @Resource
    private QuestionTypeService questionTypeService;

    //跳转到添加问题页面
    @RequestMapping("question-add")
    @ModelAttribute("questionTypeList")
    public List<QuestionType> questionAdd(){ return questionTypeService.findAll(); }
}
